{template 'admin','header'}
<form action="{$self_url}?action=search" onsubmit="return r_submit(this);">
<table width="100%" cellpadding="0">
<tr><td width="50">&nbsp;&nbsp;<strong>组名称:</strong></td><td><input type="text" size="25" value="{$gname}" name="gname">&nbsp;<input type="submit" class="button_style" value="搜索"></td></tr>
</table>
</form>
<form name='form1' action="{$self_url}?action=listorder" method="POST" onsubmit="return r_submit(this);">
<table class="table_list">
 <caption>组管理列表</caption>
 <tr>
	 <th width="80" class="align_c"><input type="checkbox" onclick="checkall(this,'ck')" id="chkall">全选/取消</th>
	 <th width="50" class="align_c">排序</th>
	 <th class="align_c">组名称</th>
	 <th class="align_c" width="150">添加时间</th>
	 <th width="250" class="align_c">操作</th>
 </tr>
 {loop $list $g}
 {php $g_perms = isset($view_list[$g['g_id']]) ? $view_list[$g['g_id']] : array()}
 <tr>
 <td class="align_c"><input type="checkbox" id="ck" {if check_perms('G011', $g_perms)===false} disabled {/if} value="{$g['g_id']}" name="ck[]"></td>
 <td class="align_c"><input type="text" size="6" {if check_perms('G010', $g_perms)===false} disabled {/if} name="listorder[{$g['g_id']}]" value="{$g['listorder']}"></td>
 <td class="align_c">{$g['g_name']}</td>
 <td class="align_c">{date('Y-m-d H:i:s',$g['inputtime'])}</td>
 <td class="align_c">
 	{if check_perms('G008', $g_perms)===true}<a href="{$self_url}?action=resource&gid={$g['g_id']}&forward={$forward}">组权限</a> | {/if}
 	{if check_perms('G009', $g_perms)===true}<a href="{$self_url}?action=roles&gid={$g['g_id']}&forward={$forward}">组角色</a> | {/if}
 	{if check_perms('G004', $g_perms)===true}<a href="{$self_url}?action=users&forward={$forward}&gid={$g['g_id']}">组成员</a> | {/if}
 	{if check_perms('G003', $g_perms)===true}<a href="{$self_url}?action=edit&gid={$g['g_id']}&forward={$forward}">修改</a> | {/if}
 	{if check_perms('G011', $g_perms)===true}<a href="javascript:my_request('{$self_url}?action=del&gid={$g['g_id']}','确认要删除吗？')">删除</a>{/if}
 </td>
 </tr>
 {/loop}
</table>
<div class="button_box">
{if check_perms('G010')===true}<input type="button" value=" 排序 " onclick="change_opt('form1','{$self_url}?action=listorder')" class="button_style">{/if}
&nbsp;
{if check_perms('G002')===true}
<input type="button" value=" 添加组 " onclick="self.location='{$self_url}?action=add&forward={$forward}'" class="button_style">
&nbsp;
{/if}
{if check_perms('G011')===true}<input type="button" value="批量删除" onclick="if(confirm('确定要删除选中的组？')){change_opt('form1','{$self_url}?action=delall');}" class="button_style">{/if}
</div>
</form>

<div id="pages">
{$pages}
</div>
{template 'admin','footer'}